.class public Lcom/umeng/fb/a/d;
.super Ljava/lang/Thread;


# static fields
.field private static b:Ljava/util/concurrent/ExecutorService;


# instance fields
.field private a:Landroid/content/Context;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const/4 v0, 0x3

    invoke-static {v0}, Ljava/util/concurrent/Executors;->newFixedThreadPool(I)Ljava/util/concurrent/ExecutorService;

    move-result-object v0

    sput-object v0, Lcom/umeng/fb/a/d;->b:Ljava/util/concurrent/ExecutorService;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    iput-object p1, p0, Lcom/umeng/fb/a/d;->a:Landroid/content/Context;

    return-void
.end method


# virtual methods
.method public run()V
    .locals 14

    const/4 v13, 0x0

    const/4 v6, 0x0

    const/4 v12, -0x1

    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    iget-object v1, p0, Lcom/umeng/fb/a/d;->a:Landroid/content/Context;

    const-string v3, "feedback"

    invoke-virtual {v1, v3, v6}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v3

    invoke-interface {v3}, Landroid/content/SharedPreferences;->getAll()Ljava/util/Map;

    move-result-object v1

    invoke-interface {v1}, Ljava/util/Map;->keySet()Ljava/util/Set;

    move-result-object v1

    invoke-interface {v1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v4

    :cond_0
    :goto_0
    invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-nez v1, :cond_3

    invoke-interface {v2}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v4

    move v5, v6

    :cond_1
    :goto_1
    invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-nez v1, :cond_4

    if-eqz v5, :cond_2

    new-instance v1, Landroid/content/Intent;

    invoke-direct {v1}, Landroid/content/Intent;-><init>()V

    const-string v2, "postFeedbackFinished"

    invoke-virtual {v1, v2}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;

    move-result-object v1

    iget-object v2, p0, Lcom/umeng/fb/a/d;->a:Landroid/content/Context;

    invoke-virtual {v2, v1}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V

    :cond_2
    return-void

    :cond_3
    invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/String;

    invoke-interface {v3, v1, v13}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/umeng/common/b/g;->c(Ljava/lang/String;)Z

    move-result v5

    if-nez v5, :cond_0

    const-string v5, "fail"

    invoke-virtual {v1, v5}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v5

    if-eq v5, v12, :cond_0

    :try_start_0
    new-instance v5, Lorg/json/JSONArray;

    invoke-direct {v5, v1}, Lorg/json/JSONArray;-><init>(Ljava/lang/String;)V

    new-instance v1, Lcom/umeng/fb/b;

    invoke-direct {v1, v5}, Lcom/umeng/fb/b;-><init>(Lorg/json/JSONArray;)V

    invoke-interface {v2, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v1

    goto :goto_0

    :cond_4
    invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    move-object v0, v1

    check-cast v0, Lcom/umeng/fb/b;

    move-object v2, v0

    iget-object v1, v2, Lcom/umeng/fb/b;->b:Lcom/umeng/fb/b$a;

    sget-object v6, Lcom/umeng/fb/b$a;->d:Lcom/umeng/fb/b$a;

    if-eq v1, v6, :cond_1

    iget-object v1, v2, Lcom/umeng/fb/b;->b:Lcom/umeng/fb/b$a;

    sget-object v6, Lcom/umeng/fb/b$a;->a:Lcom/umeng/fb/b$a;

    if-eq v1, v6, :cond_1

    iget-object v1, v2, Lcom/umeng/fb/b;->f:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v6

    move v7, v5

    move v5, v12

    :cond_5
    :goto_2
    invoke-interface {v6}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-nez v1, :cond_6

    move v5, v7

    goto :goto_1

    :cond_6
    invoke-interface {v6}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/umeng/fb/a;

    add-int/lit8 v5, v5, 0x1

    iget-object v8, v1, Lcom/umeng/fb/a;->g:Lcom/umeng/fb/a$a;

    sget-object v9, Lcom/umeng/fb/a$a;->b:Lcom/umeng/fb/a$a;

    if-ne v8, v9, :cond_5

    iget-object v8, v2, Lcom/umeng/fb/b;->c:Ljava/lang/String;

    invoke-interface {v3, v8, v13}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    :try_start_1
    new-instance v9, Lorg/json/JSONArray;

    invoke-direct {v9, v8}, Lorg/json/JSONArray;-><init>(Ljava/lang/String;)V

    iget-object v8, v1, Lcom/umeng/fb/a;->h:Lorg/json/JSONObject;

    const-string v10, "state"

    sget-object v11, Lcom/umeng/fb/a$a;->d:Lcom/umeng/fb/a$a;

    invoke-virtual {v8, v10, v11}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    move-result-object v8

    invoke-virtual {v9, v5, v8}, Lorg/json/JSONArray;->put(ILjava/lang/Object;)Lorg/json/JSONArray;

    invoke-interface {v3}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v8

    iget-object v10, v2, Lcom/umeng/fb/b;->c:Ljava/lang/String;

    invoke-virtual {v9}, Lorg/json/JSONArray;->toString()Ljava/lang/String;

    move-result-object v9

    invoke-interface {v8, v10, v9}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    move-result-object v8

    invoke-interface {v8}, Landroid/content/SharedPreferences$Editor;->commit()Z
    :try_end_1
    .catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_1

    new-instance v8, Lcom/umeng/fb/a/f;

    iget-object v1, v1, Lcom/umeng/fb/a;->h:Lorg/json/JSONObject;

    iget-object v9, p0, Lcom/umeng/fb/a/d;->a:Landroid/content/Context;

    invoke-direct {v8, v1, v9}, Lcom/umeng/fb/a/f;-><init>(Lorg/json/JSONObject;Landroid/content/Context;)V

    if-eqz v8, :cond_5

    sget-object v1, Lcom/umeng/fb/a/d;->b:Ljava/util/concurrent/ExecutorService;

    invoke-interface {v1, v8}, Ljava/util/concurrent/ExecutorService;->submit(Ljava/util/concurrent/Callable;)Ljava/util/concurrent/Future;

    const/4 v1, 0x1

    move v7, v1

    goto :goto_2

    :catch_1
    move-exception v1

    goto :goto_2
.end method
